package com.lc;

import com.lc.config.TemplatesUtils;
import com.lc.domain.Templates;
import freemarker.template.TemplateException;

import java.io.File;
import java.io.IOException;

public class Test {
    public static void main(String[] args) throws TemplateException, IOException {
        String path = System.getProperty("user.dir");
        String srcPath = path + File.separator + "cod-demo" + File.separator + "demo0";
        System.out.println(srcPath);
        BaseCopy.copyByHutool(srcPath,path);


        //模板在哪里
        String inputFile = path + File.separator +"lc-code-basic"+ File.separator + "src/main/resources/templates/templates.html.ftl";
        //D:\proj\lc-g\cod-demo\demo0\src\main\java\com\lc\generator
        String outputFile = path + File.separator + "demo0/src/main/java/com/lc/generator/StaticGenerator.java";
        System.out.println("output--->" + outputFile);
        Templates templates = new Templates();
        templates.setAuthor("lc");
        templates.setOutput("结果");
        templates.setLoop(false);
        TemplatesUtils.generateAndInject(inputFile,outputFile,templates);
    }
}
